import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop016_删除前台侧边设置"

#1.点击“添加侧边设置”按钮，显示名称“网站很好看”，排序255，点击“保存侧边显示信息”。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
#打开三级菜单
DBshopEnterMenu3(firefox,"商品管理","管理分类","前台侧边设置")
#2.点击“删除”按钮，确定删除，删除成功。
firefox.find_element_by_xpath("//td[contains(.,'%s')]/following-sibling::td[3]/a[2]"%setname).click()
firefox.switch_to.alert.accept()
time.sleep(5)
try:
    firefox.find_element_by_xpath("//td[contains(.,'s%')]"%setname)
    writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()

